<template>
	<view style="margin-top: 20rpx;margin-bottom: 20rpx;">
		<view class="biao">
			<span class="biao_span">|</span> 
			<text style="font-size: 24rpx;">{{text.cooperation}} :</text>
		</view>
		<view class="flex" style="margin-top: 10rpx;">
			<image :src="cooperation.img" class="cooperation_img" ></image>
			<view class="cooperation_list">
				<view class="cooperation_name">{{cooperation.name}}</view>
				<view style="margin-top: 20rpx;" class="flex"><image class="cooperation_icon" v-for="(it, ind) in cooperation.iconlist" :key="ind" :src="it.image"></image></view>
			</view>
			<view class="jiantou" @click="details(cooperation)" style="position: relative;z-index: 33;">
				>
			</view>
		</view>
	</view>
</template>

<script>
	import {HTTP_REQUEST_URL,HTTP_IMG_UTL,IMAGE_URL} from "@/config/app";
	
	export default {
		components: {
			
		},
		props:{
			order:{
				type:[Array,Object],
				default:{}
			}
		},
		data() {
			return {
				//远程域名
				HTTP_IMG_UTL,
				HTTP_REQUEST_URL,
				IMAGE_URL,
				url: IMAGE_URL,
				
				//语言
				lang: this.$i18n.locale,
				//文字
				text:{			
					cooperation:this.$t('合作伙伴'),
				},
				//合作伙伴
				cooperation:{
						img:HTTP_IMG_UTL+'huangjin.png',
						name:'厂家名称',
						iconlist:[],
				},
				
			}
		},
		mounted() {
			if(this.order.user_id !=this.order.release_user.id){
				this.cooperation.img = this.IMAGE_URL+this.order.release_user.avatar
				if(this.lang=='zh'){
					this.cooperation.name = this.order.release_user.username
				}else{
					this.cooperation.name = this.order.release_user.username_ru
				}
				
				this.cooperation.iconlist = this.order.release_user.iconlist 
			}else{
				this.cooperation.img = this.IMAGE_URL+this.order.join_user.avatar
				if(this.lang=='zh'){
					this.cooperation.name = this.order.join_user.username
				}else{
					this.cooperation.name = this.order.join_user.username_ru
				}
				this.cooperation.iconlist = this.order.join_user.iconlist
			}
			this.cooperation.id = this.order.release_user.id 
		},
		methods:{
			details(i) {
				// console.log(i);
				if(this.order.role==2){
					this.$u.route({
						url: "/pages/user/homePage/homePage",
						params: {
							id: this.order.orderInfo.release_user_id,
						}
					})
				}else{
					this.$u.route({
						url: "/pages/user/homePage/homePage",
						params: {
							id: this.order.orderInfo.join_user_id,
						}
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/common/orderDetail.scss";
</style>